import { MaterialIcons } from 'taro-icons';


/**
 * 根据驾驶证类型获取对应的图标
 * @param license - 驾驶证类型代码（如'A1'、'C1'等）
 * @returns 对应的React图标组件
 */
export const getLicenseIcon = (license: string): JSX.Element => {
    switch(license) {
        case 'A1':
        case 'A3':
            return <MaterialIcons name="directions-bus" size={12} color='#fff' />;
        case 'A2':
        case 'M':
            return <MaterialIcons name="tractor" size={12} color='#fff' />;
        case 'B1':
            return <MaterialIcons name="minibus" size={12} color='#fff' />;
        case 'B2':
            return <MaterialIcons name="local-shipping" size={12} color='#fff' />;
        case 'C1':
        case 'C2':
        case 'C3':
        case 'C4':
        case 'C5':
        case 'C6':
            return <MaterialIcons name="directions-car" size={12} color='#fff' />;
        case 'D':
            return <MaterialIcons name="two-wheeler" size={12} color='#fff' />;
        case 'E':
        case 'F':
            return <MaterialIcons name="directions-bike" size={12} color='#fff' />;
        case 'N':
        case 'P':
            return <MaterialIcons name="train" size={12} color='#fff' />;
        default:
            return <MaterialIcons name="directions-car" size={12} color='#fff' />;
    }
};
